-- @owner: @zou_jialiang050
-- @date: 2022/09/15
-- @testpoint: show create function指定非当前schema下存在function_name，合理报错

--step1:创建表及函数;expect:成功
drop schema if exists s_show_create_function_0008 cascade;
create schema s_show_create_function_0008;
create table s_show_create_function_0008.t_show_create_function_0008(c1 int,c2 int,c3 int);

create or replace function s_show_create_function_0008() returns trigger as
$$
declare
begin
    insert into t_show_create_function_0008 values(new.id1, new.id2, new.id3);
    return new;
end
$$ language plpgsql;
/

--step2:show create function指定非当前schema下存在function_name;expect:合理报错
show create function public.f_show_create_function_0008;

--step3:清理环境;expect:成功
drop function if exists s_show_create_function_0008.f_show_create_function_0008;
drop table if exists s_show_create_function_0008.t_show_create_function_0008;
drop schema if exists s_show_create_function_0008 cascade;